<extend name="Public/common" />
<block name="body">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>渠道管理</h3>
      <ul class="tab-base">
        	<li><a href="{:U('index')}"><span>列表</span></a></li>
	        <li><a href="JavaScript:void(0);" class="current"><span>新增</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="form1" method="post" name="form1">
    <table class="table tb-type2">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="channel_name">渠道名称:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="" name="channel_name" id="channel_name" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
            <td colspan="2" class="required"><label class="validation" for="channel_value">渠道编号值:</label></td>
        </tr>
        <tr class="noborder">
            <td class="vatop rowform"><input type="text" value="0" name="channel_value" id="channel_value" class="txt"></td>
            <td class="vatop tips">微信要求的必须整数。 场景值ID，临时二维码时为32位非0整型，永久二维码时最大值为100000（目前参数只支持1--100000）</td>
        </tr>
         <tr>
          <td colspan="2" class="required"><label for="channel_desc">备注说明:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><textarea name="channel_desc" rows="6" class="tarea" id="channel_desc"></textarea></td>
          <td class="vatop tips"><span class="vatop rowform">简单的说明，防止备忘</span></td>
        </tr>
      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submit"><span>提交</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script src="__JS__/jquery.ajaxContent.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#submit").click(function(){
	    if($("#form1").valid()){
	     $("#form1").submit();
		}
	});

	$("#form1").validate({
		errorPlacement: function(error, element){
			error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        rules : {
        	channel_name : {
                required : true
            },
            channel_value : {
                required : true,
                number   : true
            }
        },
        messages : {
            channel_name : {
                required : '渠道名称必须填写'
            },
            channel_value : {
                required : '渠道编号值必须填写',
                number   : '必须是不为0的整数'
            }
        }
	});	
});
</script>
</block>